﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;

namespace LogisticsDAL
{
   public class LogDAL
    {
        //登录方法
        public static SqlDataReader loguser(string count,string pwd)
        {
            //string sql = "p_log";
            string sql = "select UserID,UserName,Account,Password from UserInfo where Account=@Account and Password=@password";
           SqlParameter[] pram =
            {
               new SqlParameter("@Account",SqlDbType.VarChar,30),
               new SqlParameter("@password",SqlDbType.VarChar,30)
            };
            pram[0].Value = count;
            pram[1].Value = pwd;
            
           SqlDataReader read=DBHelper.getExreaders(sql, pram);
            
            return read;
    }

        /// <summary>
        /// 用户管理页面，gridview绑定
        /// </summary>
        /// <returns></returns>
        public static SqlDataReader Gvlist()
        {
            string sql = "p_read";
            SqlParameter[] pram =
            {

            };
            SqlDataReader read = DBHelper.Exreader(sql, pram);
            return read;
        }

       

        public static SqlDataReader ddrole()
        {
            string sql = "p_rolenam";
            SqlParameter[] pram =
            {
                
            };
            return DBHelper.Exreader(sql,pram);
        }
    }
}
